package com.eadaula05.arquivos;
import java.io.*;

import javax.swing.JOptionPane;

public class GravarObject {
	public static void main (String[] args){
		try{
			File f = new File("dados.txt");
			ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f, true));
			
			String newLine = " ";
			newLine = JOptionPane.showInputDialog(null, "Insira um texto");
			
			oos.writeObject(newLine);
			oos.flush();
			oos.close();
		} catch (Exception ex){
			System.out.println("Ocorreu um erro na gravação");
			ex.printStackTrace();
		}
	}
}
